package com.molichuxing.services.infrastructure.service;

import com.molichuxing.framework.dto.Paged;
import com.molichuxing.framework.service.RootService;
import com.molichuxing.services.infrastructure.dto.response.GoodsDealerDto;
import com.molichuxing.services.property.GoodsDealerStatusEnum;

import java.util.List;

/**
 * @create_date: 2019/4/3
 * 商品分销
 * @name:goods-service
 * @author xuelin yi
 **/
public interface GoodsAuthService extends RootService {

    /**
     * 根据商品ID获取未授权和已授权的经销商
     * @param goodsId
     * @param dealerId
     * @param goodsDealerStatusEnum
     * @param pageNum
     * @param pageSize
     * @return
     */
    public Paged<GoodsDealerDto> getDealerPage(Integer goodsId, List<Integer> dealerId, GoodsDealerStatusEnum goodsDealerStatusEnum, int pageNum, int pageSize);

    /**
     * 根据商品ID获取未授权和已授权的经销商
     * @param goodsId
     * @param dealerId
     * @param goodsDealerStatusEnum
     * @return
     */
    public List<GoodsDealerDto> getDealerList(Integer goodsId, List<Integer> dealerId, GoodsDealerStatusEnum goodsDealerStatusEnum);

    /**
     * 设置商品和经销商的分销状态
     * @param goods
     * @param dealerId
     * @param goodsDealerStatusEnum
     * @return
     */
    public Boolean settingGoodsDistribution(Integer goods, Integer dealerId, GoodsDealerStatusEnum goodsDealerStatusEnum);

    /**
     * 授权商品和分销商的关系
     * @param goodsIds
     * @param dealerIds
     * @return
     * @throws Exception
     */
    public Boolean createGoodsDealer(List<Integer> goodsIds, List<Integer> dealerIds) throws Exception;

    /**
     * 删除分销商和商品关系
     * @param dealerId
     * @return
     */
    public int deleteDealerRelation(Integer dealerId, List<Integer> goodsIds);
}
